import request from "@/utils/request"
import type { trademarkModel, trademarkPageListModel, trademarksModel } from "./model/trademarkModel";

enum API{
  // 获取分页列表 GET /admin/product/baseTrademark/{page}/{limit}
  getPageList="/admin/product/baseTrademark",
  // 添加商品品牌 POST /admin/product/baseTrademark/save
  saveTrademark="/admin/product/baseTrademark/save",
  // 修改商品品牌 PUT /admin/product/baseTrademark/update
  updateTrademark="/admin/product/baseTrademark/update",
  // 删除商品品牌 DELETE /admin/product/baseTrademark/remove/{id}
  removeTrademark="/admin/product/baseTrademark/remove"
}
// 获取分页列表
export const getPageListApi=(page:number,limit:number)=>{
  return request.get<any,trademarkPageListModel>(API.getPageList+`/${page}/${limit}`)
}
// 添加商品品牌
export const saveTrademarkApi=(trademark:trademarkModel)=>{
  return request.post(API.saveTrademark,trademark)
}
// 修改商品品牌
export const updateTrademarkApi=(trademark:trademarkModel)=>{
  return request.put(API.updateTrademark,trademark)
}
// 删除商品品牌

export const removeTrademarkApi=(id:number)=>{
  return request.delete(API.removeTrademark+`/${id}`)
}